/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.admanager.piadladmanagement.plugin.piadladmanagement.impl;

import java.util.Collection;

import org.admanager.piadladmanagement.plugin.piadladmanagement.Architecture;
import org.admanager.piadladmanagement.plugin.piadladmanagement.Component;
import org.admanager.piadladmanagement.plugin.piadladmanagement.Connection;
import org.admanager.piadladmanagement.plugin.piadladmanagement.Connector;
import org.admanager.piadladmanagement.plugin.piadladmanagement.PiadladmanagementPackage;

import org.admanager.piadladmanagement.plugin.piadladmanagement.Relay;
import org.admanager.piadladmanagement.plugin.piadladmanagement.Unification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Architecture</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.admanager.piadladmanagement.plugin.piadladmanagement.impl.ArchitectureImpl#getComponents <em>Components</em>}</li>
 *   <li>{@link org.admanager.piadladmanagement.plugin.piadladmanagement.impl.ArchitectureImpl#getConnectors <em>Connectors</em>}</li>
 *   <li>{@link org.admanager.piadladmanagement.plugin.piadladmanagement.impl.ArchitectureImpl#getUnifications <em>Unifications</em>}</li>
 *   <li>{@link org.admanager.piadladmanagement.plugin.piadladmanagement.impl.ArchitectureImpl#getRelays <em>Relays</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ArchitectureImpl extends ElementImpl implements Architecture {
	/**
	 * The cached value of the '{@link #getComponents() <em>Components</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getComponents()
	 * @generated
	 * @ordered
	 */
	protected EList components;

	/**
	 * The cached value of the '{@link #getConnectors() <em>Connectors</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConnectors()
	 * @generated
	 * @ordered
	 */
	protected EList connectors;

	/**
	 * The cached value of the '{@link #getUnifications() <em>Unifications</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUnifications()
	 * @generated
	 * @ordered
	 */
	protected EList unifications;

	/**
	 * The cached value of the '{@link #getRelays() <em>Relays</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRelays()
	 * @generated
	 * @ordered
	 */
	protected EList relays;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ArchitectureImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return PiadladmanagementPackage.Literals.ARCHITECTURE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getComponents() {
		if (components == null) {
			components = new EObjectContainmentEList(Component.class, this, PiadladmanagementPackage.ARCHITECTURE__COMPONENTS);
		}
		return components;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getConnectors() {
		if (connectors == null) {
			connectors = new EObjectContainmentEList(Connector.class, this, PiadladmanagementPackage.ARCHITECTURE__CONNECTORS);
		}
		return connectors;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getUnifications() {
		if (unifications == null) {
			unifications = new EObjectContainmentEList(Unification.class, this, PiadladmanagementPackage.ARCHITECTURE__UNIFICATIONS);
		}
		return unifications;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getRelays() {
		if (relays == null) {
			relays = new EObjectContainmentEList(Relay.class, this, PiadladmanagementPackage.ARCHITECTURE__RELAYS);
		}
		return relays;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case PiadladmanagementPackage.ARCHITECTURE__COMPONENTS:
				return ((InternalEList)getComponents()).basicRemove(otherEnd, msgs);
			case PiadladmanagementPackage.ARCHITECTURE__CONNECTORS:
				return ((InternalEList)getConnectors()).basicRemove(otherEnd, msgs);
			case PiadladmanagementPackage.ARCHITECTURE__UNIFICATIONS:
				return ((InternalEList)getUnifications()).basicRemove(otherEnd, msgs);
			case PiadladmanagementPackage.ARCHITECTURE__RELAYS:
				return ((InternalEList)getRelays()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case PiadladmanagementPackage.ARCHITECTURE__COMPONENTS:
				return getComponents();
			case PiadladmanagementPackage.ARCHITECTURE__CONNECTORS:
				return getConnectors();
			case PiadladmanagementPackage.ARCHITECTURE__UNIFICATIONS:
				return getUnifications();
			case PiadladmanagementPackage.ARCHITECTURE__RELAYS:
				return getRelays();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case PiadladmanagementPackage.ARCHITECTURE__COMPONENTS:
				getComponents().clear();
				getComponents().addAll((Collection)newValue);
				return;
			case PiadladmanagementPackage.ARCHITECTURE__CONNECTORS:
				getConnectors().clear();
				getConnectors().addAll((Collection)newValue);
				return;
			case PiadladmanagementPackage.ARCHITECTURE__UNIFICATIONS:
				getUnifications().clear();
				getUnifications().addAll((Collection)newValue);
				return;
			case PiadladmanagementPackage.ARCHITECTURE__RELAYS:
				getRelays().clear();
				getRelays().addAll((Collection)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case PiadladmanagementPackage.ARCHITECTURE__COMPONENTS:
				getComponents().clear();
				return;
			case PiadladmanagementPackage.ARCHITECTURE__CONNECTORS:
				getConnectors().clear();
				return;
			case PiadladmanagementPackage.ARCHITECTURE__UNIFICATIONS:
				getUnifications().clear();
				return;
			case PiadladmanagementPackage.ARCHITECTURE__RELAYS:
				getRelays().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case PiadladmanagementPackage.ARCHITECTURE__COMPONENTS:
				return components != null && !components.isEmpty();
			case PiadladmanagementPackage.ARCHITECTURE__CONNECTORS:
				return connectors != null && !connectors.isEmpty();
			case PiadladmanagementPackage.ARCHITECTURE__UNIFICATIONS:
				return unifications != null && !unifications.isEmpty();
			case PiadladmanagementPackage.ARCHITECTURE__RELAYS:
				return relays != null && !relays.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //ArchitectureImpl
